package com.woniuxy.commons.entity.wyh;


import com.woniuxy.commons.entity.StudentInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.List;
import java.util.Objects;

/**
 * 班级信息表
 *
 * @author wyh
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@ApiModel("班级实体")
public class TeamInfo {
    //主键
    @ApiModelProperty("班级id")
    private Integer teId;
    //班级名称
    private String tname;
    //班级人数
    private Integer tnumber;
    //班级类型  （文科、理科、默认）
    private String teamType;
    //班主任id 
    private Integer tmId;
    //年级id
    private Integer gaId;
    //状态 默认0 正常 1删除
    private Integer flag;
    //班级最大人数
    private Integer maxnumber;
    //预留字段
    private Integer test3;

    //年级属性
    private GradeInfo gradeInfo;

    //班主任信息
    private TeamMaster teamMaster;

    //所有的学生信息
    private List<StudentInfo> studentInfos;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof TeamInfo)) return false;
        TeamInfo teamInfo = (TeamInfo) o;
        return Objects.equals(getTeId(), teamInfo.getTeId()) &&
                Objects.equals(getTname(), teamInfo.getTname()) &&
                Objects.equals(getTnumber(), teamInfo.getTnumber()) &&
                Objects.equals(getTeamType(), teamInfo.getTeamType()) &&
                Objects.equals(getTmId(), teamInfo.getTmId()) &&
                Objects.equals(getGaId(), teamInfo.getGaId()) &&
                Objects.equals(getFlag(), teamInfo.getFlag()) &&
                Objects.equals(getMaxnumber(), teamInfo.getMaxnumber()) &&
                Objects.equals(getTest3(), teamInfo.getTest3()) &&
                Objects.equals(getGradeInfo(), teamInfo.getGradeInfo()) &&
                Objects.equals(getTeamMaster(), teamInfo.getTeamMaster());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getTeId(), getTname(), getTnumber(), getTeamType(), getTmId(), getGaId(), getFlag(), getMaxnumber(), getTest3(), getGradeInfo(), getTeamMaster());
    }
}